package com.jboost.hyk.clazz.entity;


import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.jboost.common.system.base.entity.JBoostEntity;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * @Description: 备授课
 * @Author: cxn
 * @Date:   2022-11-29
 * @Version: V1.0
 */
@Data
@TableName("hyk_class")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="hyk_class对象", description="备授课")
public class HykClass extends JBoostEntity{

    @TableLogic
    /**delFlag*/
    @ApiModelProperty(value = "delFlag")
    private Integer delFlag;

    /**businessId*/
    @ApiModelProperty(value = "businessId")
    private String businessId;

    /**班级名称*/
    @ApiModelProperty(value = "班级名称")
    private String name;

    /**授课用户id，用#分割*/
    @ApiModelProperty(value = "授课老师用户id，用#分割")
    private String teachingIds;

    /**班级状态：进行中-progress；已结课-complete；*/
    @ApiModelProperty(value = "班级状态：进行中-progress；已结课-complete；")
    private String status;

    private Date teachingTime;
    private Date completeTime;

    /**对应的教学课程id*/
    @ApiModelProperty(value = "对应的教学课程id")
    private String classCourseId;

    private String classCourseName;

    private String teachingCourseId;

    /**讲次总数*/
    @ApiModelProperty(value = "讲次总数")
    private Integer lectureCount;

    /**完成上课讲次数量*/
    @ApiModelProperty(value = "完成上课讲次数量")
    private Integer lectureComplete;

    /**当前班级学生的数量*/
    @ApiModelProperty(value = "当前班级学生的数量")
    private Integer studentCount;

    public void addLectureComplete(int num) {
        if (null == lectureComplete){
            lectureComplete = 0;
        }
        lectureComplete+=num;
        if (null !=lectureCount && lectureComplete > lectureCount){
            lectureComplete = lectureCount;
        }
    }
}
